//
//  PKReadCollectionViewCell.m
//  PianKe
//
//  Created by lanou on 15/12/28.
//  Copyright (c) 2015年 KFC. All rights reserved.
//

#import "PKReadCollectionViewCell.h"

@implementation PKReadCollectionViewCell


- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        
        
        _coverImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, frame.size.width, frame.size.height)];
        _coverImageView.backgroundColor = [UIColor greenColor];
        [self.contentView addSubview:_coverImageView];
        
        _titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, frame.size.height * 4 / 5, frame.size.width, frame.size.height / 5)];
        _titleLabel.backgroundColor = [UIColor blackColor];
        _titleLabel.font = [UIFont systemFontOfSize:12];
        _titleLabel.textColor = [UIColor whiteColor];
        _titleLabel.alpha = 0.4;
        [self.contentView addSubview:_titleLabel];
        
        
    }
    
    return self;
}

// 重写setmodel方法
- (void)setModel:(PKReadModel *)model
{
    _model = model;
    
    // 赋值
    _titleLabel.text = [NSString stringWithFormat:@"%@ %@",model.name,model.enname];
    [_coverImageView sd_setImageWithURL:[NSURL URLWithString:model.coverimg] placeholderImage:nil];
}


@end
